package com.azure.bigstore.repository;

import com.azure.bigstore.entity.Category;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by liuhuaibin on 2018/1/23.
 */
public interface CategoryRepository extends JpaRepository<Category,Long> {

    public List<Category> findByPid(long pid);

    @Query(value = "select * from t_category where grade = 2",nativeQuery = true)
    public List<Category> getCategoriesGrade2();
}
